﻿package base
{
    import com.core.display.*;
    import flash.filters.*;
    import flash.text.*;

    public class Common extends Object
    {
        public static const YELLOW_FILTER:GlowFilter = new GlowFilter(16776960, 0.5, 1, 1);
        public static const BLACK_FILTER:GlowFilter = new GlowFilter(0, 1, 2, 2);
        public static const YELLOW_FILTER_8:GlowFilter = new GlowFilter(16776960, 0.5, 8, 8);
        public static const BROWN_FORMAT:TextFormat = new TextFormat("宋体", 12, "0xC39E69", null, null, null, null, null, TextFormatAlign.LEFT);

        public function Common()
        {
            return;
        }// end function

        public static function getTextField(param1:String = "", param2:int = 100, param3:int = 18) : TextField
        {
            var _loc_4:TextField = null;
            _loc_4 = new TextField();
            _loc_4.mouseEnabled = false;
            _loc_4.tabEnabled = false;
            _loc_4.text = param1;
            _loc_4.width = param2;
            _loc_4.height = param3;
            _loc_4.defaultTextFormat = BROWN_FORMAT;
            _loc_4.filters = [BLACK_FILTER];
            return _loc_4;
        }// end function

        public static function getItemNum(param1:int = 0, param2:int = -1, param3:int = -1) : int
        {
            var _loc_6:Object = null;
            var _loc_7:Object = null;
            var _loc_8:int = 0;
            var _loc_4:* = UserData.getBagData();
            var _loc_5:int = 0;
            switch(param1)
            {
                case 1:
                {
                    _loc_5 = _loc_4.money;
                    break;
                }
                default:
                {
                    for (_loc_6 in _loc_4)
                    {
                        
                        _loc_7 = _loc_4[_loc_6];
                        if (_loc_7)
                        {
                            if (_loc_7.hasOwnProperty("4"))
                            {
                                if (_loc_7[2] == 2)
                                {
                                    _loc_8 = _loc_7[1];
                                    _loc_7 = _loc_7[4];
                                    if (_loc_7 && _loc_7.hasOwnProperty("itemid"))
                                    {
                                        if (_loc_7.itemid == param2 || _loc_7.itemid == param3)
                                        {
                                            _loc_5 = _loc_5 + _loc_8;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    break;
                    break;
                }
            }
            return _loc_5;
        }// end function

    }
}
